package com.tfswx.jkgl.core.yzfs;

import com.tfswx.jkgl.core.yzfs.base.YzfsBase;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * @author ricky
 * @date 2021/12/5
 */
@Component
public class NotBlank implements YzfsBase {
    @Override
    public boolean isValid(Object value, Object yzz) {
        if (value == null) {
            return false;
        }
        String s = value.toString();
        return StringUtils.isNotBlank(s);
    }

    @Override
    public String getName() {
        return "不为空或空字符串（字符串）";
    }

    @Override
    public boolean sfxycs() {
        return false;
    }

    @Override
    public String getMessage() {
        return "不能为空";
    }

    @Override
    public String getYzzValue(String yzz) {
        return yzz;
    }
}
